Impact for addition of Instance Support for attributes
------------------------------------------------------

-------------------------------------------------------------------------------
* functions/item_input.php
-------------------------------------------------------------------------------
function get_item_attr_filename(...)
	- needs to include $instance_no, in case we have a specific file per
	instance, basically anything can be saved with instance_no context, even
	all attributes if configured that way.
	
functions handle_item_upload(...)
function handle_item_saveurl(...)
	- same goes here.
	
function delete_item_attribute_file(...)
	- this uses the get_item_attr_filename(...), but we will modify this
	function to accept $instance_no, and thus we will just pass that
	straight through to the get_item_attr_filename(...) function call.

NOTE: We do not want to reverse engineer the name of a file, to work out
what item_attribute it belongs to, that would be a bad thing.  We should
probably have two different item_file definitions:

$CONFIG_VARS['item_input.item_attr_file_mask'] = '{fieldname}_item{item_id}.{ext}';
$CONFIG_VARS['item_input.item_nstance_attr_file_mask'] = '{fieldname}_item{item_id}_{instance_no}.{ext}';

The $instance_no will be passed into all functions, but will be set to FALSE, if not
a item_instance context item_attribute, its up to all the functions to check this.

function handle_item_attributes(...)

Would have to check that the $item_r includes the $instance_no

-------------------------------------------------------------------------------
* functions/item.php
-------------------------------------------------------------------------------
function from_and_where_clause(...)
	- joins to item_attribute table should consider instance_no from now on.

-------------------------------------------------------------------------------
* functions/item_attribute.php
-------------------------------------------------------------------------------

function fetch_item_attribute_type_rs(...) 
function fetch_siat_with_prompt_and_val_r(...) -- THIS FUNCTION IS UNUSED!!!!
	- should include instance_ind column from s_item_attribute_type
	
function fetch_attribute_val(...)
function fetch_lookup_attribute_val_r(...)
function fetch_sattr_type_lookup_for_item_attr(...)
function fetch_item_attribute_cnt(...) -- THIS FUNCTION IS UNUSED!!!
function is_item_attribute_set(...)
function insert_item_attribute(...)
function insert_lookup_item_attributes(...)
function update_item_attribute(...)
function update_lookup_item_attributes(...)
function delete_item_attribute(...)
function delete_lookup_item_attribute(...)
function delete_lookup_item_attributes(...)
function delete_item_attributes(...)

	- Include $instance_no parameter and logic to work out whether
	  we should be restricting to $instance_no
	
So now all we need to do is investigate all calls made to functions from
the functions/item_attribute.php script to ensure they are being
called with instance_no context where required.

Files which call the functions/item_attribute.php functions
-------------------------------------------------------------------------------

* function fetch_item_attribute_type_rs(...) 
	./functions/import.php
	./functions/ItemImportHandler.class.inc
	./functions/item_input.php
	./export.php
	./import.php
	./item_display.php
	./item_input.php
	./search.php

* function fetch_attribute_val(...)
	./functions/item_input.php
	./functions/Listing.class.inc
	./functions/parseutils.php
	./site/imdb/config.php
	./export.php
	./item_display.php
	./item_input.php
	./listings.php

* function fetch_lookup_attribute_val_r(...)	
	./functions/item_input.php
	./export.php
	./item_display.php
	./item_input.php
	./listings.php
	
* function fetch_sattr_type_lookup_for_item_attr(...)
	./functions/parseutils.php

* function is_item_attribute_set(...)
	./functions/parseutils.php

* function insert_item_attribute(...)
	./functions/import.php
	./functions/item_input.php

* function insert_lookup_item_attributes(...)
	./functions/import.php
	./functions/item_input.php

* function update_item_attribute(...)
	./functions/item_input.php

* function update_lookup_item_attributes(...)
	./functions/item_input.php
	
* function delete_item_attribute(...)
	./functions/item.php
	./functions/item_input.php

* function delete_lookup_item_attribute(...)
	./functions/item_input.php

* function delete_lookup_item_attributes(...)
	./functions/item_input.php
	
* function delete_item_attributes(...)
	./functions/item.php


